<?php include_once($_SERVER['DOCUMENT_ROOT']."/controller/common/common_setting_unit.php"); ?>
<?php include_once("../controller/detail-add.php"); ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <?php include_once($_SERVER['DOCUMENT_ROOT']."/controller/common/module/head.php") ?>
    <!--kindeditor编辑器-->
    <?php include_once('modules/mod-nkeditor.php'); ?>
</head>








<body>

<div id="topbar">
    <?php include '../../../modules/topbar.php'; ?>
</div>

<div id="container">
<!--Container端點01-->
<div id="maincontent"   class="detail">
<!--maincontent端點01-->

<div id="sidebar">
<?php include '../../../modules/sidebar.php'; ?>
</div>






<div id="content">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
        <legend> 添加横幅 </legend>
    </fieldset>


<div class="detail-box banner-detail-box">

<div class="detail-box layui-form <? echo $system_part ?>">
<div class="detail-boxes">
<ul class="detail-boxing">


    <form id="detail_form" class="layui-form-pane" method="post" onsubmit="return checkRequired(ai_name);"
          action="detail-add-function.php?sys_part=<? echo $system_part ?>" enctype="multipart/form-data"
          name="uploadfile">


        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
            <legend>基本信息</legend>
        </fieldset>
        <blockquote class="layui-elem-quote">基本信息多数是对外使用的资料，请细心填写。</blockquote>
        <br/>


        <li class="layui-form-item  name">
            <label class="layui-form-label">名称：</label>
            <div class="layui-input-block">
                <input type="text" class="layui-input" name="ai_name" size="20" value="">
            </div>
            <em class="explain">(<u style="color:red">*必填项目</u>填写标题)</em>
        </li>


        <li class="layui-form-item term">
            <label class="layui-form-label">分类：</label>
            <div class="layui-input-block">


                <select name="ai_banner_term">
                        <?php for ($i = 0; $i < count($term); $i++) {?>
                        <option value="<?php echo $term[$i]['nid'] ?>"> | - <?php echo $term[$i]['name'] ?></option>
                        <?php;}?>
                </select>
            </div>

            <em class="explain">(选择对应的分类)</em></li>


        <li class="layui-form-item introduce">
            <label class="layui-form-label">简介：</label>
            <div class="layui-input-block">
                <textarea class="layui-textarea" name="ai_introduce" cols="20"></textarea>
            </div>
            <em class="explain">(填写本文的概述)</em>
        </li>


        <?php include_once("modules/mod-images-upload.php"); ?>


        <li class="layui-form-item video">
            <label class="layui-form-label">视频上传：</label>
            <div class="layui-input-block">
                <input type="file" id="upload_video"/>
                <button type="button" class="layui-btn" id="UploadAction">上传视频</button>
                <div class="layui-progress" style="margin:10px 0;" lay-filter="progress" lay-showPercent="true"
                     id="prouploadfile">
                    <div class="layui-progress-bar" lay-percent="0%"></div>
                </div>

                <video id="video" src="" controls="controls" width="100" height="100"> 您的浏览器不支持 video 标签。</video>

            </div>

            <input type="hidden" name="ai_video_path" class="video_path"/>

            <input type="hidden" id="duration" name="ai_video_time"/>
            <input type="hidden" id="video_img" name="ai_video_img"/>

            <em class="explain">视频上传中，请勿刷新或者提交</em>
        </li>

        <li class="layui-form-item detail">
            <label class="layui-form-label">资料详情：</label>
            <div class="layui-input-block">
<textarea class="layui-textarea" name="ai_detail" style="width:800px;height:400px;visibility:hidden;">
</textarea>
            </div>
        </li>


        <!--这个用来做有限次数点击-->
        <li class="layui-form-item stock"><label class="layui-form-label">库存：</label>
            <div class="layui-input-block"><input type="text" class="layui-input" name="ai_stock" size="20" value="0"
                                                  onkeyup="checknum(ai_stock);" onfocus="checkdefault(ai_stock)"
                                                  onblur="checkempty(ai_stock)"></div>
        </li>


        <li class="layui-form-item listorder">
            <label class="layui-form-label">列表排序：</label>
            <div class="layui-input-block">
                <input type="text" class="layui-input" name="ai_listorder" size="20" value="0"
                       onkeydown="onlyNum();" onfocus="checkdefault(ai_listorder)" onblur="checkempty(ai_listorder)">
            </div>
            <em class="explain">(填写本文在所属前台列表下的列表排序，数字越大，排序越靠前)</em>
        </li>


        <li class="layui-form-item recommend">
            <label class="layui-form-label">推荐状态：</label>


            <div class='radio-box'>
                <input name='ai_recommend' type='radio' value='1' id='recommend_now' title="标记推荐"/>
                <input name='ai_recommend' type='radio' value='0' id='recommend_later' checked='checked' title="取消推荐"/>

            </div>

        </li>


        <li class="layui-form-item publish">
            <label class="layui-form-label">发布状态：</label>
            <div class='radio-box'>
                <input name='ai_publish' type='radio' value='1' id='publish_now' title="立即发布"/>
                <input name='ai_publish' type='radio' value='0' id='publish_later' checked='checked' title="暂未发布"/>
            </div>
            <em class="explain">(选择立即发布，以上信息才能在前台显示；选择暂未发布，只对以上信息进行保存，不在前台显示)</em>
        </li>


        <li class="layui-form-item clickrate"><label class="layui-form-label">点击次数：</label>
            <div class="layui-input-block"><input type="text" class="layui-input" name="ai_clickrate" size="20"
                                                  value="0"
                                                  onkeydown="onlyNum();" onfocus="checkdefault(ai_clickrate)"
                                                  onblur="checkempty(ai_clickrate)"></div>
        </li>

        <li class="layui-form-item link"><label class="layui-form-label">链接地址：</label>
            <div class="layui-input-block"><input type="text" class="layui-input" name="ai_link" size="20" value="">
            </div>
        </li>


        <li class="layui-form-item onsaletime">
            <label class="layui-form-label">上架时间：</label>
            <div class="layui-input-block">
                <input type="text" class="layui-input" name="ai_onsaletime"
                       size="20" value="<? echo date("Y-m-d H:i:s") ?>"
                       onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
                       class="laydate-icon">
            </div>
        </li>


        <li class="layui-form-item offshelves">
            <label class="layui-form-label">下架时间：</label>
            <div class="layui-input-block">
                <input type="text" class="layui-input" name="ai_offshelves"
                       size="20" value="<? echo date("Y-m-d H:i:s") ?>"
                       onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
                       class="laydate-icon">
            </div>
        </li>


        <li class="layui-form-item modifytime">
            <label class="layui-form-label">修改时间：</label>
            <div class="layui-input-block">
                <input type="text" class="layui-input" name="ai_modifytime"
                       size="20" value="<? echo date("Y-m-d H:i:s") ?>"
                       onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
                       class="laydate-icon">
            </div>
        </li>

        <hr/>


        <div class="function">
            <input type="submit" class="layui-btn" value="确认"/>
            <input type="reset" class="layui-btn" value="重置"/>
        </div>
    </form>
</ul>
</div>
</div>

<!--content端點01-->
</div>
<!--maincontent端點01-->
<br class="clearfloat" />
</div>
<!--container端點01-->
</div>


<?php include  ROOT_PATH_."/controller/modules/footer.php"; ?>



    <script charset="utf-8" src="modules/upload_video.js"></script>

    <script>
        var filePath_ = "/uploadfiles/" + "<?php echo $theme_folder?>" + "/";
        var videoUploadSwitch_ = false;
        var Browser = new Object();

        Browser.isMozilla = (typeof document.implementation != 'undefined') && (typeof document.implementation.createDocument != 'undefined') && (typeof HTMLDocument != 'undefined');
        Browser.isIE = window.ActiveXObject ? true : false;
        Browser.isFirefox = (navigator.userAgent.toLowerCase().indexOf("firefox") != - 1);
        Browser.isSafari = (navigator.userAgent.toLowerCase().indexOf("safari") != - 1);
        Browser.isOpera = (navigator.userAgent.toLowerCase().indexOf("opera") != - 1);

    </script>



</body>
</html>
